package webapp.frontOffice.servlet;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import modele.utilisateur.Entreprise;
import dao.utilisateur.EntrepriseDAO;

/**
 * Servlet implementation class Societe
 */
@WebServlet("/societe")
public class Societe extends HttpServlet {
	private static final long serialVersionUID = 1L;

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
	{
		Entreprise societe = new EntrepriseDAO().retrieve(Long.parseLong(request.getParameter("id")));
		request.setAttribute("societe", societe);
		
		RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/WEB-INF/viewFrontoffice/societe.jsp");
		dispatcher.forward(request, response);
	}

}
